package com.zhouyu.config;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice(basePackages = "com.zhouyu.controller")
@Component
public class ApplicationConfig {

	@ExceptionHandler(NullPointerException.class)
	public void nullPointerExceptionHandle(Exception e) {
		System.out.println("nullPointerExceptionHandle triggered....");
	}

	@ExceptionHandler(RuntimeException.class)
	public void runtimeExceptionHandle(Exception e) {
		System.out.println("runtimeExceptionHandle triggered....");
	}
}
